package no.ntnu.fp.services.impl;

import java.util.List;

import no.ntnu.fp.model.Appointment;
import no.ntnu.fp.model.Employee;
import no.ntnu.fp.services.AppointmentService;
import no.ntnu.fp.storage.AppointmentStorage;

public class AppointmentServiceImpl extends EntityServiceImpl<Appointment> implements AppointmentService {

	private final AppointmentStorage appointmentStorage ;
	
	public AppointmentServiceImpl(AppointmentStorage appointmentStorage) {
		this.appointmentStorage = appointmentStorage;
	}

	public List<Appointment> getApppointmentsByEmployee(Employee employee) {
		return appointmentStorage.getAppointmentsByEmployee(employee);
	}

	@Override
	public Appointment addAppointment(Appointment appointment) {
		return appointmentStorage.save(appointment);
	}

	@Override
	public Appointment updateAppointment(Appointment appointment) {
		return appointmentStorage.update(appointment);
	}

	@Override
	public void deleteAppointment(Appointment appointment) {
		appointmentStorage.deleteAppointment(appointment);
	}
}
